

<h3><?php echo h($post['Post']['title']); ?></h3>

<p><small>Created: <?php echo $post['Post']['create_time']; ?> &nbsp &nbsp<?php echo '   by: '.$userpost ;  ?></small></p>

<p><?php echo h($post['Post']['body']); ?></p>

<?php if($likeCount==0||$likeCount==1) echo $likeCount.' like';
      else echo $likeCount.' likes.';
      
      if($likeOrNot){
            echo '&nbsp You like this post';
            
            echo $this->Form->create('Like',array('action'=>'likeOrUnlikePost'));
            echo $this->Form->input('post_id',array('type'=>'hidden','value'=>$post['Post']['id'])); 
            echo $this->Form->end('UnLike');
      }
      else{
            echo $this->Form->create('Like',array('action'=>'likeOrUnlikePost'));
            echo $this->Form->input('post_id',array('type'=>'hidden','value'=>$post['Post']['id'])); 
            echo $this->Form->end('Like');
      }
 ?>
 
<br>
<br>
<p class="text-success"><h3>Comment</h3></p>

<table class='table bordered'>
    <?php foreach ($comments as $comment): ?>
    <tr>
    <td><?php echo $comment['users']['username']?></td>
    <td><?php echo $comment['comments']['content']?></td>
    <td><?php echo $comment['comments']['create_time']?></td>
    </tr>
    <?php endforeach; ?>
    
</table>


<?php
echo $this->Form->create('Comment', array('action' => 'savecomment'));
echo $this->Form->input('content', array('rows' => '3'));
echo $this->Form->input('post_id',array('type'=>'hidden','value'=>$post['Post']['id']));
echo $this->Form->end('Save Comment');
?>